package com.huanying.goodjob.lottery;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.huanying.framework.user.User;
import com.huanying.goodjob.prize.Prize;

@Entity
@Table(name = "lottery")
public class Lottery implements Serializable{
	private static final long serialVersionUID = -8714406550574846572L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	 @OneToOne(cascade = { CascadeType.ALL })
	 @JoinColumn(name = "user_id")
     private User user;  //中奖人
	 @OneToOne(cascade = { CascadeType.ALL })
	 @JoinColumn(name = "prize_id")
	 private Prize prize;  //奖品
	 private Double longitude;  //经度
	 private Double latitude;  //纬度
	 private Timestamp create_time;
	 @Column(name = "status", nullable = false, columnDefinition = "INT default 1")
	private int status;   //状态
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Prize getPrize() {
		return prize;
	}
	public void setPrize(Prize prize) {
		this.prize = prize;
	}
	public Double getLongitude() {
		return longitude;
	}
	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}
	public Double getLatitude() {
		return latitude;
	}
	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}
	public Timestamp getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Timestamp create_time) {
		this.create_time = create_time;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
}
